package com.qinyi.common.ajax;


/**
 * @author wangan on 2019/6/4
 * @description
 */
public class AjaxResult<T> {

    private int code;
    private String msg;
    private T data;

    public AjaxResult(AjaxCode code) {
        this.code = code.getCode();
        this.msg = code.getMsg();
    }

    public AjaxResult(AjaxCode code, T data) {
        this.code = code.getCode();
        this.msg = code.getMsg();
        this.data = data;
    }

    public int getCode() {
        return code;
    }


    public String getMsg() {
        return msg;
    }


    public T getData() {
        return data;
    }


    @Override
    public String toString() {
        return "AjaxResult{" +
                "code=" + code +
                ", msg='" + msg + '\'' +
                ", data=" + data +
                '}';
    }
}
